<% /* $Id: contests.jsp 132 2011-08-26 10:23:42Z altdotua@gmail.com $ */ %>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%@ include file="../header.jsp" %>	

<h2 align="center">Contests</h2>

<%= DJudgeUtils.generateTable(request, response, ContestEntry.class, ContestsModel.getCore()) %>

<%
	ContestEntry entry = ContestsModel.getEntry(Long.parseLong(request.getParameter("id")));
%>
<h2><%= entry == null ? "Add contest" : "Edit contest \"" + entry + "\"" %></h2>

<form action="<%= Linker.link("contests") %>" method="post">
	<input type="hidden" name="action" value="edit">
	<input type="hidden" name="return" value="<%= request.getRequestURL() %>">
  <p><input type="hidden" name="id" value="<%= null == entry ? "" : entry.getId() %>"></p>
  <p>SID: <input name="sid" value="<%= null == entry ? "" : entry.getSid() %>"></p>
  <p>Name: <input name="name" value="<%= null == entry ? "" : entry.getName() %>"></p>
  <p>Type: <input name="type" value="<%= null == entry ? "" : entry.getContestType() %>"></p>
  <p><input type="checkbox" name="active" <%= null == entry || !entry.getActive() ? "" : "checked='checked'" %>>Active?</p>
  <p>Start: <input name="startTime" value="<%= null == entry ? "" : entry.getStartTime() %>"></p>
  <p>Finish: <input name="finishTime" value="<%= null == entry ? "" : entry.getFinishTime() %>"></p>
  <p>Freeze: <input name="freezeTime" value="<%= null == entry ? "" : entry.getFreezeTime() %>"></p>
  <p><input type="submit" value="Submit"></p>
</form>


<%@ include file="../footer.jsp" %>